package com.example.servicegateway.entity;

import com.example.servicegateway.authentication.constant.ResultCode;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class GeneralResult {

    /**
     * 响应编码
     */
    protected String code;

    /**
     * 响应的详细信息
     */
    protected String msg;

    private Object data;

    public static GeneralResult failed(ResultCode resultCode) {
        return new GeneralResult(resultCode.getCode(), resultCode.getMsg(), null);
    }
}
